﻿<UserControl x:Class="WpfChess.WpfPresentation.View.PawnTransformationView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:Controls="clr-namespace:WpfLab.Controls;assembly=WpfLab.Controls"
             xmlns:View1="clr-namespace:WpfChess.WpfPresentation.View" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <Controls:ModalDialogPopup IsOpen="{Binding Path=IsPawnTransformationPopup, Mode=TwoWay}">
        <Controls:ModalDialogPopup.HostedContent>
            <ContentControl>
                <Grid Height="60" Width="300">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="0"/>
                        <RowDefinition Height="60*"/>
                    </Grid.RowDefinitions>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="60*"/>
                        <ColumnDefinition Width="60*"/>
                        <ColumnDefinition Width="60*"/>
                        <ColumnDefinition Width="60*"/>
                    </Grid.ColumnDefinitions>

                    <View1:FigureView x:Name="RookFigureView" Margin="2 0 2 0" Grid.Column="0" Grid.Row="1" DataContext="{Binding Path=RookFigureCell.Figure}">
                        <View1:FigureView.InputBindings>
                            <MouseBinding Command="{Binding DataContext.FigureSelectionCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}}" CommandParameter="RookFigure" Gesture="LeftClick" />
                        </View1:FigureView.InputBindings>
                    </View1:FigureView>
                    <View1:FigureView x:Name="KnightFigureView" Margin="2 0 2 0" Grid.Column="1" Grid.Row="1" DataContext="{Binding Path=KnightFigureCell.Figure}">
                        <View1:FigureView.InputBindings>
                            <MouseBinding Command="{Binding DataContext.FigureSelectionCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}}" CommandParameter="KnightFigure" Gesture="LeftClick" />
                        </View1:FigureView.InputBindings>
                    </View1:FigureView>
                    <View1:FigureView x:Name="BishopFigureView" Margin="2 0 2 0" Grid.Column="2" Grid.Row="1" DataContext="{Binding Path=BishopFigureCell.Figure}">
                        <View1:FigureView.InputBindings>
                            <MouseBinding Command="{Binding DataContext.FigureSelectionCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}}" CommandParameter="BishopFigure" Gesture="LeftClick" />
                        </View1:FigureView.InputBindings>
                    </View1:FigureView>
                    <View1:FigureView x:Name="QueenFigureView" Margin="2 0 2 0" Grid.Column="3" Grid.Row="1" DataContext="{Binding Path=QueenFigureCell.Figure}">
                        <View1:FigureView.InputBindings>
                            <MouseBinding Command="{Binding DataContext.FigureSelectionCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Grid}}}" CommandParameter="QueenFigure" Gesture="LeftClick" />
                        </View1:FigureView.InputBindings>
                    </View1:FigureView>
                </Grid>
            </ContentControl>
        </Controls:ModalDialogPopup.HostedContent>
    </Controls:ModalDialogPopup>
</UserControl>
